<?php
class Users3 extends CI_Controller {
	
	function __construct() {
		// load controller parent
		parent::__construct ();
		// load 'Users' model
		$this->load->model ( 'Users_model3' );
	}
	
	function display($row = 0) {
		// load pagination library
		$this->load->library ( 'pagination' );
		// set pagination parameters
		$config ['base_url'] = 'http://localhost/Intro_part1/index.php/users3/display/';
		$config ['total_rows'] = $this->Users_model3->getNumUsers ();
		$config ['per_page'] = '5';
		$this->pagination->initialize ( $config );
		// store data for being displayed on view file
		$data ['users'] = $this->Users_model3->getUsers ( $row );
		$data ['title'] = 'Displaying user data';
		$data ['header'] = 'User List';
		$data ['links'] = $this->pagination->create_links ();
		// load 'testview' view
		$this->load->view ( 'users_view_p', $data );
	
	}
}
?>